// import com.alibaba.druid.DbType_ptr;
// import com.alibaba.druid.sql.ast.SQLObject;
// import com.alibaba.druid.sql.ast.SQLStatementImpl;
// import com.alibaba.druid.sql.visitor.SQLASTVisitor;

// import java.util.ArrayList;
// import java.util.List;

#include "SQLExplainAnalyzeStatement.h"
#include "../../visitor/SQLASTVisitor.h"
#include "SQLSelect.h"

SQLExplainAnalyzeStatement::SQLExplainAnalyzeStatement()
{
}

SQLExplainAnalyzeStatement::SQLExplainAnalyzeStatement(DbType_ptr dbType)
    : SQLStatementImpl(dbType)
{
}

// @Override
void SQLExplainAnalyzeStatement::accept0(SQLASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(SQLExplainAnalyzeStatement)))
  {
    acceptChild(visitor, select);
  }
  visitor->endVisit(SharedObject(SQLExplainAnalyzeStatement));
}

// @Override
SQLObject_list_ptr SQLExplainAnalyzeStatement::getChildren()
{
  SQLObject_list_ptr children = std::make_shared<std::list<SQLObject_ptr>>();
  if (select != nullptr)
  {
    children->push_back(select);
  }
  return children;
}

SQLSelect_ptr SQLExplainAnalyzeStatement::getSelect()
{
  return select;
}

void SQLExplainAnalyzeStatement::setSelect(SQLSelect_ptr select)
{
  this->select = select;
}
